﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Voucher.aspx.cs" Inherits="School.Pages.Admission.Voucher" MasterPageFile="~/MasterALSafa.Master" %>

<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<script language="javascript">
    function CallPrint(strid) {
        var prtContent = document.getElementById(strid);
        var WinPrint = window.open('', '', 'letf=0,top=0,width=550,height=550,toolbar=0,scrollbars=0,status=0');
        WinPrint.document.write('<div dir=rtl>' + prtContent.innerHTML + '</div>');
        WinPrint.document.close();
        WinPrint.focus();
        WinPrint.print();
        WinPrint.close();

    }</script>

<div align="center" dir="rtl">

    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
        <asp:Panel ID="pnlAdd" runat="server" Visible="false">
            <table width="100%" align="center" cellpadding="0" cellspacing="0" border="0">
                <tr>
                    <td colspan="4" class="admintitle">
                        ادخال بيانات
                    </td>
                </tr>
                <tr>
                    <td>
                        رقم&nbsp; أمر الدفع</td>
                    <td align="right">
                        <asp:TextBox ID="txtPayment_Order_Number" runat="server" CssClass="text" 
                            Width="150px" ontextchanged="txtPayment_Order_Number_TextChanged" 
                            AutoPostBack="True"></asp:TextBox>
                         <asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server" 
                            ControlToValidate="txtPayment_Order_Number" CssClass="required" Display="Dynamic" 
                            ErrorMessage="*"></asp:RequiredFieldValidator>
                        &nbsp;</td>
                    <td style="color: #000000">
                        التاريخ</td>
                    <td align="right">
                        <asp:TextBox ID="txtDate" runat="server"></asp:TextBox>
                        <asp:CalendarExtender ID="TextBox1_CalendarExtender" runat="server" 
                            Enabled="True" TargetControlID="txtDate">
                        </asp:CalendarExtender>
                    </td>
                </tr>
                <tr>
                    <td>
                        النوع </td>
                    <td align="right">
                        <asp:DropDownList ID="ddlExpense_Id" runat="server" AutoPostBack="True" 
                            Enabled="False"> 
                           
                        </asp:DropDownList>
                    </td>
                    <td>
                        <asp:Label ID="Label1" runat="server" CssClass="lab" Text="المجمع"></asp:Label>
                    </td>
                    <td align="right">
                        <asp:DropDownList ID="ddlcampus_Id" runat="server" Enabled="False" 
                            onselectedindexchanged="ddlcampus_Id_SelectedIndexChanged" Width="200px" >
                            
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <td >
                        <asp:Label ID="lblFirstname" runat="server" CssClass="lab" Text="الاسم الاول"></asp:Label>
                    </td>
                    <td align="right">
                        <asp:TextBox ID="txtFirstName" runat="server" CssClass="text" Width="150px"></asp:TextBox>
                    </td>
                    <td >
                        <asp:Label ID="lblCertificate_Id" runat="server" CssClass="lab" 
                            Text="نوع الشهادة"></asp:Label>
                    </td>
                    <td align="right" >
                        <asp:DropDownList ID="ddlCertificate_Id" runat="server" Enabled="False" 
                            onselectedindexchanged="ddlCertificate_Id_SelectedIndexChanged" 
                            Width="200px">
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Label ID="lblSecondName" runat="server" Text="الاسم الثاني" CssClass="lab"></asp:Label>
                    </td>
                    <td align="right">
                        <asp:TextBox ID="txtSecondName" runat="server" Width="150px" CssClass="text"></asp:TextBox>
                    </td>
                    <td>
                        <asp:Label ID="lblStage_Id" runat="server" CssClass="lab" Text="مرحلة القيد"></asp:Label>
                    </td>
                    <td align="right">
                        <asp:DropDownList ID="ddlStage_Id" runat="server" Enabled="False" 
                            onselectedindexchanged="ddlStage_Id_SelectedIndexChanged" Width="200px">
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Label ID="lblThirdName" runat="server" Text="الاسم الثالث" CssClass="lab"></asp:Label>
                    </td>
                    <td align="right">
                        <asp:TextBox ID="txtThirdName" runat="server" Width="150px" CssClass="text"></asp:TextBox>
                    </td>
                    <td>
                        <asp:Label ID="lblGrade_Id" runat="server" Text="الصف" CssClass="lab"></asp:Label>
                    </td>
                    <td align="right">
                        <asp:DropDownList ID="ddlGrade_Id" runat="server" Enabled="False" Width="200px">
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Label ID="lblFourthName" runat="server" Text="الاسم الرابع" CssClass="lab"></asp:Label>
                    </td>
                    <td align="right">
                        <asp:TextBox ID="txtFourthName" runat="server" Width="150px" CssClass="text"></asp:TextBox>
                    </td>
                
                <td>
                        <asp:Label ID="Label2" runat="server" Text="المبلغ" CssClass="lab"></asp:Label>
                    </td>
                    <td align="right">
                        <asp:TextBox ID="txtValue" runat="server" Width="150px" CssClass="text"></asp:TextBox>
                    </td>
                </tr>
                
                
                <tr>
                    <td>
                        بيان</td>
                    <td align="right" colspan="3">
                        <asp:TextBox ID="txtDetail" runat="server" CssClass="text" Width="100%" 
                            Height="52px"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        الخصم</td>
                    <td align="right">
                        <asp:DropDownList ID="ddlDiscount_Id" runat="server" AutoPostBack="True">
                        </asp:DropDownList>
                    </td>
                    <td>
                        &nbsp;</td>
                    <td align="right">
                        &nbsp;</td>
                </tr>
                <tr>
                    <td>
                        &nbsp;</td>
                    <td align="right">
                        <asp:CheckBox ID="CHKIs_Active" runat="server" Text="Is Active" />
                    </td>
                    <td>
                        &nbsp;</td>
                    <td align="right">
                        <asp:CheckBox ID="CHIs_Closed" runat="server" Text="Is Closed" />
                    </td>
                </tr>
                
                
                <tr>
                    <td colspan="4">
                        <asp:Label ID="lblErrorMessage" runat="server" CssClass="error"></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td colspan="4">
                        <asp:Button ID="btnSave" runat="server" CssClass="graybutton" 
                            OnClick="btnSave_Click" Text="انشاء فاتورة" />

                        &nbsp;<asp:Button ID="btnCancel" runat="server" CssClass="graybutton" CausesValidation="False"
                            OnClick="btnCancel_Click" Text="تفريغ الحقول" />
                        &nbsp;<asp:Button ID="btnend" runat="server" CssClass="graybutton" CausesValidation="False"
                            OnClick="btnend_Click" Text="انهاء" />
                    </td>
                </tr>
            </table>
        </asp:Panel>
    </div>
    <br />
    <div align="center">
        <asp:Panel ID="pnlbrows" runat="server" Visible="true">
            <table width="100%" align="center" cellpadding="0" cellspacing="0" border="0">
                <tr>
                    <td colspan="2" class="admintitle">
                        عرض البيانات
                    </td>
                </tr>
                <tr>
                    <td colspan="2">
                        <table width="90%" align="center" cellpadding="0" cellspacing="0" border="0">
                            <tr>
                                <td>
                                    رقم الفاتورة</td>
                                <td align="right">
                                    <asp:TextBox ID="txtSearchNumber" runat="server" CssClass="text" 
                                        Width="150px" ontextchanged="txtSearchNumber_TextChanged"></asp:TextBox>
                                </td>
                                <td>
                                    التاريخ</td>
                                <td align="right">
                                    <asp:TextBox ID="txtSearchDate" runat="server" CssClass="text" 
                                        Width="150px"></asp:TextBox>
                                    <asp:CalendarExtender ID="txtSearchDate_CalendarExtender" runat="server" 
                                        Enabled="True" TargetControlID="txtSearchDate">
                                    </asp:CalendarExtender>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    رقم الطالب</td>
                                <td align="right">
                                    <asp:TextBox ID="txtSearchStudent_Id" runat="server" CssClass="text" Width="150px"></asp:TextBox>
                                </td>
                                <td>
                                    رقم الملف</td>
                                <td align="right">
                                    <asp:TextBox ID="txtSearchFile_Number" runat="server" CssClass="text" Width="150px"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    النوع
                                </td>
                                <td align="right">
                                    <asp:DropDownList ID="ddlSearchExpense_Id" runat="server" AutoPostBack="True">
                                    </asp:DropDownList>
                                </td>
                                <td>
                                    رقم&nbsp; أمر الدفع</td>
                                <td align="right">
                                    <asp:TextBox ID="txtSearchPayment_Order_Number" runat="server" CssClass="text" 
                                        Width="150px"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    &nbsp;</td>
                                <td align="right">
                                    &nbsp;</td>
                                <td>
                                    <asp:Label ID="Label15" runat="server" CssClass="lab" 
                                        Text="المجمع"></asp:Label>
                                </td>
                                <td align="right">
                                    <asp:DropDownList ID="ddlSearchcampus_Id" runat="server" AutoPostBack="True" 
                                        onselectedindexchanged="ddlSearchcampus_Id_SelectedIndexChanged">
                                    </asp:DropDownList>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:Label ID="lblFirstname0" runat="server" CssClass="lab" Text="الاسم الاول"></asp:Label>
                                </td>
                                <td align="right">
                                    <asp:TextBox ID="txtSearchFirstName" runat="server" CssClass="text" Width="150px"></asp:TextBox>
                                    
                                </td>
                                <td>
                                    <asp:Label ID="lblCertificate_Id0" runat="server" CssClass="lab" 
                                        Text="نوع الشهادة"></asp:Label>
                                </td>
                                <td align="right">
                                    <asp:DropDownList ID="ddlSearchCertificate_Id" runat="server" 
                                        AutoPostBack="True">
                                    </asp:DropDownList>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:Label ID="lblSecondName0" runat="server" CssClass="lab" 
                                        Text="الاسم الثاني"></asp:Label>
                                </td>
                                <td align="right">
                                    <asp:TextBox ID="txtSearchSecondName" runat="server" CssClass="text" Width="150px"></asp:TextBox>
                                    

                                </td>
                                <td>
                                    <asp:Label ID="lblStage_Id0" runat="server" CssClass="lab" Text="مرحلة القيد"></asp:Label>
                                </td>
                                <td align="right">
                                    <asp:DropDownList ID="ddlSearchStage_Id" runat="server" AutoPostBack="True">
                                    </asp:DropDownList>
                                   
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:Label ID="lblThirdName0" runat="server" CssClass="lab" Text="الاسم الثالث"></asp:Label>
                                </td>
                                <td align="right">
                                    <asp:TextBox ID="txtSearchThirdName" runat="server" CssClass="text" Width="150px"></asp:TextBox>
                                
                                </td>
                                <td>
                                    <asp:Label ID="lblGrade_Id0" runat="server" CssClass="lab" Text="الصف"></asp:Label>
                                </td>
                                <td align="right">
                                    <asp:DropDownList ID="ddlSearchGrade_ID" runat="server" AutoPostBack="True">
                                    </asp:DropDownList>
                                 
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:Label ID="lblFourthName0" runat="server" CssClass="lab" 
                                        Text="الاسم الرابع"></asp:Label>
                                </td>
                                <td align="right">
                                    <asp:TextBox ID="txtSearchFourthName" runat="server" CssClass="text" Width="150px"></asp:TextBox>
                                </td>
                                <td>
                                    &nbsp;</td>
                                <td align="right">
                                    &nbsp;</td>
                            </tr>
                            <tr>
                                <td>
                                    &nbsp;</td>
                                <td>
                                    &nbsp;</td>
                                <td>
                                    &nbsp;</td>
                                <td style="text-align: right">
                                    &nbsp;</td>
                            </tr>
                            <tr>
                                <td colspan="4">
                                    <asp:Button ID="btnSearch" runat="server" Text="بحث" CssClass="graybutton" OnClick="btnSearch_Click" />&nbsp;<asp:Button 
                                        ID="btnAdd" runat="server" CssClass="graybutton" OnClick="btnAdd_Click" 
                                        Text="اضافة جديد" />
                                    &nbsp;<asp:Button
                                        ID="btnGetAll" runat="server" Text="الكل" CssClass="graybutton" OnClick="btnGetAll_Click" />
                                </td>
                            </tr>
                            <tr>
                                <td style="text-align: right" colspan="4">
                                    <asp:Label CssClass="lableface" ID="lblRecordNo" runat="server"></asp:Label>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="4">
                                    <asp:GridView Width="100%" AllowPaging="True" AllowSorting="True" ID="griddata" runat="server"
                                        CssClass="Grid" HeaderStyle-CssClass="GridHeaderFooter" FooterStyle-CssClass="GridHeaderFooter"
                                        PagerStyle-CssClass="GridPager" 
                                        AlternatingRowStyle-CssClass="GridItemAltername" 
                                        AutoGenerateColumns="False" 
                                        onselectedindexchanged="griddata_SelectedIndexChanged" 
                                        OnRowDeleting="griddata_RowDeleting" DataKeyNames="Number" 
                                        onrowdatabound="griddata_RowDataBound" 
                                        onpageindexchanging="griddata_PageIndexChanging">
                                        <AlternatingRowStyle CssClass="GridItemAltername" />
                                        <Columns>
                                            <asp:BoundField DataField="Number" HeaderText="رقم الفاتورة" />
                                            <asp:BoundField DataField="Payment_Order_Number" HeaderText="رقم أمر الدفع" />
                                            <asp:BoundField DataField="Date" HeaderText="التاريخ" 
                                                DataFormatString="{0:yyyy-MM-dd}" />
                                            <asp:CommandField ShowSelectButton="True" SelectText="View" />
                                            <asp:TemplateField ShowHeader="False" Visible="False">
                                                                <ItemTemplate>
                                                                    <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" CommandName="Delete"
                                                                        Text="Delete"></asp:LinkButton>
                                                                </ItemTemplate>
                                                            </asp:TemplateField>

                                        </Columns>
                                        <FooterStyle CssClass="GridHeaderFooter" />
                                        <HeaderStyle CssClass="GridHeaderFooter" />
                                        <PagerStyle CssClass="GridPager" />
                                    </asp:GridView>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="4">
                                    <asp:Label CssClass="error" ID="lblMessage" runat="server"></asp:Label>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="4" align="right">
                                    &nbsp;</td>
                            </tr>
                        </table>
                    </td>
                </tr>
            </table>
        </asp:Panel>
    </div>
    <br />
    
    <asp:Panel ID="pnldetails" runat="server" Visible="false">
    <div align="center" id="DivContent" >
        <asp:Panel ID="Panel1" runat="server" >
            <table width="100%" align="center" cellpadding="0" cellspacing="0" border="0">
                <tr>
                    <td colspan="4" class="admintitle">
                        الفاتورة</td>
                </tr>
                <tr>
                    <td>
                        التاريخ</td>
                    <td align="right">
                        <asp:TextBox ID="txtShowDate" runat="server" CssClass="text" Width="150px"></asp:TextBox>
                    </td>
                    <td>
                        <asp:Label ID="Label4" runat="server" CssClass="lab" 
                            Text="الرقم"></asp:Label>
                    </td>
                    <td align="right">
                        <asp:TextBox ID="txtShowNumber" runat="server" CssClass="text" 
                            Width="150px"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Label ID="Label5" runat="server" CssClass="lab" Text="اسم الطالب"></asp:Label>
                    </td>
                    <td align="right">
                        <asp:TextBox ID="txtShowName" runat="server" CssClass="text" Width="150px"></asp:TextBox>
                    </td>
                    <td>
                        السعر</td>
                    <td align="right">
                        <asp:TextBox ID="txtShowValue" runat="server" CssClass="text" Width="150px"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Label ID="Label12" runat="server" Text="المجمع" CssClass="lab"></asp:Label>
                    </td>
                    <td align="right">
                        <asp:TextBox ID="txtShowCampus" runat="server" CssClass="text" Width="150px" 
                            ontextchanged="txtShowCampus_TextChanged"></asp:TextBox>
                    </td>
                    <td>
                        <asp:Label ID="Label16" runat="server" CssClass="lab" Text="النوع"></asp:Label>
                    </td>
                    <td align="right">
                        &nbsp;</td>
                </tr>
                <tr>
                    <td>
                        <asp:Label ID="Label13" runat="server" Text="نوع الشهادة" CssClass="lab"></asp:Label>
                    </td>
                    <td align="right">
                        <asp:TextBox ID="txtShowCertificate" runat="server" CssClass="text" 
                            ontextchanged="txtShowCampus_TextChanged" Width="150px"></asp:TextBox>
                    </td>
                    <td>
                        بيان</td>
                    <td align="right" rowspan="2">
                        <asp:TextBox ID="txtShowDetail" runat="server" CssClass="text"
                            Width="100%"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        المرحلة</td>
                    <td align="right">
                        <asp:TextBox ID="txtShowStage" runat="server" CssClass="text" 
                            ontextchanged="txtShowCampus_TextChanged" Width="150px"></asp:TextBox>
                    </td>
                
                <td>
                        &nbsp;</td>
                </tr>
                
                
                <tr>
                    <td>
                        <asp:Label ID="Label14" runat="server" CssClass="lab" Text="الصف"></asp:Label>
                    </td>
                    <td align="right">
                        <asp:TextBox ID="txtShowGrade" runat="server" CssClass="text" 
                            ontextchanged="txtShowCampus_TextChanged" Width="150px"></asp:TextBox>
                    </td>
                    <td>
                        &nbsp;</td>
                    <td align="right">
                        التوقيع</td>
                </tr>       
                <tr>
                    <td colspan="4">
                        &nbsp;</td>
                </tr>
            </table> 
        </asp:Panel> 
        </div> 

        <a href="javascript:CallPrint('DivContent')">
                                <asp:Label ID="Label7" runat="server" Height="14" Width="80" Text="طباعة" style="font-size:10px;font-family:verdana;color:#000000;border:thin;border-style: solid;border-width:0px;height:14pt;	width :80pt; border-color:#D2CFCF;background-color:#D2CFCF;"></asp:Label>
                            </a>
                                    
        <div align="center" id="DivContent2" >
            <table align="center" cellpadding="0" cellspacing="0" border="0" width="90%" dir="rtl">
                <tr>
                    <td class="admintitle" colspan="3">
                        &nbsp;</td>
                </tr>
                <tr>
                    <td>
                        <asp:DetailsView Width="100%" ID="DetViewdata" runat="server" AlternatingRowStyle-CssClass="GridItemAltername"
                            CssClass="Grid" HeaderStyle-CssClass="GridHeaderFooter" 
                            HeaderStyle-Width="30%" AutoGenerateRows="False">
                            <AlternatingRowStyle CssClass="GridItemAltername" />
                            <Fields>
                                <asp:BoundField DataField="Number" HeaderText="رقم الفاتورة" />
                                <asp:BoundField DataField="Payment_Order_Number" HeaderText="رقم أمر الدفع" />
                                <asp:BoundField DataField="Date" DataFormatString="{0:yyyy-MM-dd}" 
                                    HeaderText="التاريخ" />
                            </Fields>
                            <HeaderStyle CssClass="GridHeaderFooter" Width="30%" />
                        </asp:DetailsView>
                    </td>
                </tr>
               
            </table>

        </Div>
        <table align="center" cellpadding="0" cellspacing="0" border="0" width="50%" dir="rtl">
        <tr>
        <td><a href="javascript:CallPrint('DivContent2')">
                        <asp:Label ID="PrntLabel0" runat="server" Height="14px" 
                            style="font-size:10px;font-family:verdana;color:#000000;border:0px solid #D2CFCF; height:14pt;	width :80pt; background-color:#D2CFCF; text-align: center;" 
                            Text="طباعة" Width="80px"></asp:Label>
                        </a></td>
        <td><input type="button" value="رجوع" onclick="history.go(-1)" class="graybutton" /></td>
        </tr>
                        
                        
        </table>
        </asp:Panel>
         
</asp:Content>
